<script>
  //父类
  class Animal {
    weight
    constructor(weight) {
      this.weight = weight
      // console.log(this, "111")
    }

    run() {
      console.log("在田野中奔跑")
    }
  }

  // let a = new Animal(100)

  // //子类
  class Dog extends Animal {
    constructor(weight) {
      // this.weight=weight
      super(weight)
    }

    bark(){
      console.log("汪汪叫")
    }

  }

  let d = new Dog(100)
  // d.run()
  d.bark()





  // let a = new Animal(100)
  // // console.log(a.weight)
  // a.run()


</script>